﻿<UserControl x:Class="SLExtensions.Showcase.PageAnimatingFillPanel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:slec="clr-namespace:SLExtensions.Controls;assembly=SLExtensions.Controls"
    xmlns:ext="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:controllers="clr-namespace:SLExtensions.Showcase.Controllers"
    >
    <UserControl.Resources>
        <controllers:PageAnimatingFillPanelController x:Key="controller" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <TextBlock Text="Animated flow layout. Resize columns to see animation" Grid.ColumnSpan="2"/>
        <ItemsControl Grid.Row="1" x:Name="itemsPanel" ItemsSource="{Binding TagCloud, Source={StaticResource controller}}" >
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <slec:AnimatingTilePanel SameSizeItems="false" />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Border>
                        <TextBlock Margin="4" Text="{Binding Name}" FontSize="{Binding Size}"/>
                    </Border>
                </DataTemplate>
            </ItemsControl.ItemTemplate>

        </ItemsControl>
        <ext:GridSplitter Grid.Row="1" Grid.Column="0" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>
    </Grid>
</UserControl>
